<template>
  <div>
    <IndexTop :c1="true" :c2="true" :c3="true"></IndexTop>
    <div class="topBorder"></div>
    <div class="exBox flex f-s">
      <div class="BoxL">
        <div class="H1 flex f-s f18 c6">个人中心</div>
        <div class="userInfoListBox flex f-s">
          <template v-for="(v, k) in boxLArr">
            <div class="userInfoH flex f-s f16 c6" :key="k + 'userInfoH'">
              {{ v.text }}
            </div>
            <template v-for="(rv, rk) in v.arr">
              <div
                class="userInfoText flex f-s f14 c9"
                :class="{ userInfoTextOn: rv.falg }"
                :key="k + 'userInfoText' + rk"
                @click="goRouter(k, rk, rv.routerName)"
              >
                {{ rv.text }}
              </div>
            </template>
          </template>
        </div>
      </div>
      <div class="BoxR">
        <router-view></router-view>
      </div>
    </div>
    <Footer></Footer>
  </div>
</template>

<script>
import IndexTop from "../IndexTop";
import Footer from "../../Footer";
export default {
  name: "myAccount",
  mounted() {
    this.$store.commit("setTagArrItem", -1);
  },
  data() {
    return {
      boxLArr: [
        {
          text: "交易管理     >",
          arr: [
            {
              text: "我的账户",
              routerName: "myAccountUI",
              falg: true,
            },
            {
              text: "我的订单",
              routerName: "Order",
              falg: false,
            },
            {
              text: "我的积分",
              routerName: "MyJf",
              falg: false,
            },
            {
              text: "积分订单",
              routerName: "MyJfDd",
              falg: false,
            },
            {
              text: "我的钱包",
              routerName: "MyQb",
              falg: false,
            },
          ],
        },
        {
          text: "会员资料     >",
          arr: [
            {
              text: "个人资料",
              routerName: "myAccountUI",
              falg: false,
            },
            {
              text: "地址管理",
              routerName: "myAccountUI",
              falg: false,
            },
            {
              text: "我的收藏",
              routerName: "myAccountUI",
              falg: false,
            },
            {
              text: "最近浏览",
              routerName: "myAccountUI",
              falg: false,
            },
            {
              text: "修改密码",
              routerName: "myAccountUI",
              falg: false,
            },
          ],
        },
        {
          text: "站内信        >",
          arr: [
            {
              text: "我的消息",
              routerName: "myAccountUI",
              falg: false,
            },
            {
              text: "意见反馈",
              routerName: "myAccountUI",
              falg: false,
            },
          ],
        },
      ],
    };
  },
  methods: {
    goRouter(k, rk, name) {
      this.boxLArr.forEach((v) => {
        v.arr.forEach((rv) => {
          rv.falg = false;
        });
      });
      this.boxLArr[k].arr[rk].falg = true;
      if (this.$route.name != name) {
        this.$router.push({ name });
      }
    },
  },
  components: {
    IndexTop,
    Footer,
  },
};
</script>

<style scoped>
* {
  font-size: 0;
  color: #333333;
}
.exBox {
  width: 1280px;
  margin: 0 auto;
}
.f-s {
  justify-content: flex-start;
}
.f-e {
  justify-content: flex-end;
}
.f14c6 {
  font-size: 14px;
  color: #666666;
}
.f16c3 {
  font-size: 16px;
  color: #333333;
}
.f18 {
  font-size: 18px;
}
.f16 {
  font-size: 16px;
}
.f14 {
  font-size: 14px;
}
.c6 {
  color: #666666;
}
.c9 {
  color: #999999;
}
</style>

<style scoped>
/* 布局规划 */
.topBorder {
  width: 100%;
  border-bottom: 1px solid #e4e4e4;
}
.exBox {
  margin-top: 39px;
  margin-bottom: 47px;
  justify-content: space-between;
  align-items: flex-start;
}
.BoxL {
  width: 170px;
}
.BoxR {
  width: 1085px;
}
/* 左侧区域 */
.H1 {
  width: 168px;
  height: 57px;
  border: 1px solid #e9e9e9;
  text-indent: 20px;
}
.userInfoListBox {
  width: 168px;
  height: 554px;
  padding-top: 11px;
  border: 1px solid #e9e9e9;
  border-top: none;
  flex-direction: column;
}
.userInfoH {
  width: 168px;
  height: 34px;
  text-indent: 20px;
}
.userInfoText {
  width: 168px;
  height: 36px;
  text-indent: 20px;
  cursor: pointer;
}
.userInfoTextOn {
  color: #498e3d;
  text-decoration: underline;
}
</style>
